package com.weetop.akly.presenter;

import android.app.Activity;

import com.weetop.akly.base.mvp.BaseModel;
import com.weetop.akly.base.mvp.BaseObserver;
import com.weetop.akly.base.mvp.BasePresenter;
import com.weetop.akly.bean.ApproveItem;
import com.weetop.akly.bean.MsgBean;
import com.weetop.akly.bean.VoteItem;
import com.weetop.akly.view.VoteCenterView;

import java.util.ArrayList;
import java.util.Map;

public class VoteCenterPresent extends BasePresenter<VoteCenterView> {
    public VoteCenterPresent(VoteCenterView baseView, Activity activity) {
        super(baseView, activity);
    }

    /**
     * 获取投票列表
     */
    public void getVoteList(String page) {
        Map<String, String> params = myApplication.getGlobalData();
//        params.put("page", page);
        addDisposable(apiServer.getVoteList(), new BaseObserver<BaseModel<ArrayList<VoteItem>>>(baseView) {
            @Override
            public void onSuccess(BaseModel<ArrayList<VoteItem>> o) {
                baseView.getVoteListSuccess(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }

}
